#pragma once

#define	MAX_SATISFACTION		(1.f)
#define	MAX_MONEY_COUNT			(12)

class RectStatic;
class RectGage;
class MoneyDrawer;
class TextDrawer;

class GameStateInfo
{
public:
	GameStateInfo();
	~GameStateInfo();

public:
	void			Init(int nStageIndex, int nMoney, float fSatisfaction);	
	void			Release();
	void			Update();

	void			OnMouseMove(int nPosX, int nPosY);
	void			OnMouseLDown(int nPosX, int nPosY);
	void			OnMouseLUp(int nPosX, int nPosY)		{}

	int				GetCurProcess()					{ return m_nCurProcessTick; }	

	void			AddCurMoeny(int nAdd)			{ m_nCurMoney += nAdd;		UpdateMoneyImage(); }
	void			SetCurMoney(int nNewMoney)		{ m_nCurMoney = nNewMoney;	UpdateMoneyImage(); }	
	int				GetCurMoney()					{ return m_nCurMoney; }

	void			AddSatisfaction(float fAdd)		
	{ 
		m_fCurSatisfaction+=fAdd;
		if( m_fCurSatisfaction<0.0f ) m_fCurSatisfaction = 0.0f;
		if( m_fCurSatisfaction>1.0f ) m_fCurSatisfaction = 1.0f;
		UpdateSatisfactionImage(); 
	}
	void			SetSatisfaction(float fNew)		
	{ 
		if( m_fCurSatisfaction<0.0f ) m_fCurSatisfaction = 0.0f;
		if( m_fCurSatisfaction>1.0f ) m_fCurSatisfaction = 1.0f;
		UpdateSatisfactionImage(); 
	}

	float			GetCurSatisfaction()			{ return m_fCurSatisfaction; }	

private:
	void			UpdateProcessImage();
	void			UpdateMoneyImage();
	void			UpdateSatisfactionImage();	

private:	
	int				m_nCurProcessTick;
	int				m_nTotalProcessTick;
	float			m_fCurSatisfaction;
	int				m_nCurMoney;
	float			m_endY;
	float			m_endYp;

	RECT			m_rcSize;

	RectStatic*		m_rectBackGround;
	TextDrawer*		m_pTextMonth;
	RectGage*		m_pRectGageProcess;
	RectGage*		m_pRectGageSatisfaction;
	MoneyDrawer*	m_pMoneyDraw;

	RectStatic*		m_rectEnd;

};

GameStateInfo* GetGameStateInfo();